using System;
using Microsoft.SPOT;

namespace MicroContainer
{
   /// <summary>
   /// Marks method as container configurator/builder method.
   /// </summary>
   [AttributeUsage(AttributeTargets.Method)]
   public sealed class ContainerBuilderAttribute : Attribute
   {
      /// <summary>
      /// Gets or sets if the container should be singleton. In such case every builder method invocation returns the same
      /// sole instance.
      /// </summary>
      public bool Singleton { get; set; }

      /// <summary>
      /// Creates new <see cref="ContainerBuilderAttribute"/> instance..
      /// </summary>
      public ContainerBuilderAttribute()
      {         
      }

      /// <summary>
      /// Creates new <see cref="ContainerBuilderAttribute"/> instance.
      /// </summary>
      /// <param name="singleton">If the container should be singleton. In such case every builder method invocation returns 
      /// the same sole instance.</param>
      public ContainerBuilderAttribute(bool singleton)
      {
         Singleton = singleton;
      }
   }
}
